package object;

public class ObjectDemo {
    public static void main(String[] args) {
        /*
        Point p = new Point(10, 200);
        System.out.println(p);
        System.out.println(p.toString());
         */


        Point p1 = new Point(100, 200);
        Point p2 = new Point(100, 200);
        System.out.println(p1==p2);//false,==比较的是地址
        System.out.println(p1.equals(p2));//
        StringBuilder s1 = new StringBuilder("hello");
        StringBuilder s2 = new StringBuilder("hello");


        StringBuilder buider1 = new StringBuilder("hello");
        StringBuilder bulider2 = new StringBuilder("hello");
        //StruingBulider类没有重写equals(),因此调用的还是Object类的equals()比较地址
        System.out.println(buider1.equals(bulider2));//fasle
        System.out.println(buider1.equals(s1));//false


    }
}
